package mylab.unitconversion;

public class AreaConverter {
	//sq millimeters to sq centimeters, sq meters, sq kilometers, sq miles, hectares, acres, sq inches, sq feet, sq yards.
	public final static double MillimetersCentimetersSqFactor		=	100.0;				//1 sq centimeter	= 100 sq millimeters.
	public final static double MillimetersMetersSqFactor			=	1000000.0;			//1 sq meter		= 1000000 sq millimeters.
	public final static double MillimetersKilometersSqFactor		=	1000000000000.0;	//1 sq kilometer	= 1000000000000 sq millimeters.
	public final static double MillimetersMilesSqFactor				=	2589988110336.0;	//1 sq mile			= 2589988110336 sq millimeters.
	public final static double MillimetersHectaresSqFactor			=	10000000000.0;		//1 sq hectare		= 10000000000 sq millimeters.
	public final static double MillimetersAcresSqFactor				=	4046856446.427836;	//1 sq acre			= 4046856446.427836 sq millimeters.
	public final static double MillimetersInchesSqFactor			=	645.16;				//1 sq inch			= 645.16 sq millimeters.
	public final static double MillimetersFeetSqFactor				=	92903.043597;		//1 sq feet			= 92903.043597 sq millimeters.
	public final static double MillimetersYardsSqFactor				=	836126.972904;		//1 sq yard			= 836126.972904 sq millimeters.
	
	public static double sqMillimetersToSqCentimeters(double value){return value/MillimetersCentimetersSqFactor;}
	public static double sqCentimetersToSqMillimeters(double value){return value*MillimetersCentimetersSqFactor;}
	
	public static double sqMillimetersToSqMeters(double value){return value/MillimetersMetersSqFactor;}
	public static double sqMetersToSqMillimeters(double value){return value*MillimetersMetersSqFactor;}
	
	public static double sqMillimetersToSqKilometers(double value){return value/MillimetersKilometersSqFactor;}
	public static double sqKilometersToSqMillimeters(double value){return value*MillimetersKilometersSqFactor;}
	
	public static double sqMillimetersToSqMiles(double value){return value/MillimetersMilesSqFactor;}
	public static double sqMilesToSqMillimeters(double value){return value*MillimetersMilesSqFactor;}
	
	public static double sqMillimetersToHectares(double value){return value/MillimetersHectaresSqFactor;}
	public static double hectaresToSqMillimeters(double value){return value*MillimetersHectaresSqFactor;}
	
	public static double sqMillimetersToAcres(double value){return value/MillimetersAcresSqFactor;}
	public static double acresToSqMillimeters(double value){return value*MillimetersAcresSqFactor;}
	
	public static double sqMillimetersToSqInches(double value){return value/MillimetersInchesSqFactor;}
	public static double sqInchesToSqMillimeters(double value){return value*MillimetersInchesSqFactor;}
	
	public static double sqMillimetersToSqFeet(double value){return value/MillimetersFeetSqFactor;}
	public static double sqFeetToSqMillimeters(double value){return value*MillimetersFeetSqFactor;}
	
	public static double sqMillimetersToSqYards(double value){return value/MillimetersYardsSqFactor;}
	public static double sqYardsToSqMillimeters(double value){return value*MillimetersYardsSqFactor;}
	
	
	//sq centimeters to sq meters, sq kilometers, sq miles, hectares, acres, sq inches, sq feet, sq yards.
	public final static double CentimetersMetersSqFactor			=	10000.0;			//1 sq meter		= 10000 sq centimeters.
	public final static double CentimetersKilometersSqFactor		=	10000000000.0;		//1 sq kilometer	= 10000000000 sq centimeters.
	public final static double CentimetersMilesSqFactor				=	25899881103.36;		//q sq mile			= 25899881103.36 centimeters.
	public final static double CentimetersHectaresSqFactor			=	100000000.0;		//1 sq hectare		= 100000000 sq centimeters.
	public final static double CentimetersAcresSqFactor				=	40468564.464278;	//1 sq acre			= 40468564.464278 sq centimeters.
	public final static double CentimetersInchesSqFactor			=	6.4516;				//1 sq inch			= 6.4516 sq centimeters.
	public final static double CentimetersFeetSqFactor				=	929.030436;			//1 sq feet			= 929.030436 sq centimeters.
	public final static double CentimetersYardsSqFactor				=	8361.269729;		//1 sq yard			= 8361.269729 sq centimeters.

	public static double sqCentimetersToSqMeters(double value){return value/CentimetersMetersSqFactor;}
	public static double sqMetersToSqCentimeters(double value){return value*CentimetersMetersSqFactor;}
	
	public static double sqCentimetersToSqKilometers(double value){return value/CentimetersKilometersSqFactor;}
	public static double sqKilometersToSqCentimeters(double value){return value*CentimetersKilometersSqFactor;}
	
	public static double sqCentimetersToSqMiles(double value){return value/CentimetersMilesSqFactor;}
	public static double sqMilesToSqCentimeters(double value){return value*CentimetersMilesSqFactor;}
	
	public static double sqCentimetersToHectares(double value){return value/CentimetersHectaresSqFactor;}
	public static double hectaresToSqCentimeters(double value){return value*CentimetersHectaresSqFactor;}
	
	public static double sqCentimetersToAcres(double value){return value/CentimetersAcresSqFactor;}
	public static double acresToSqCentimeters(double value){return value*CentimetersAcresSqFactor;}
	
	public static double sqCentimetersToSqInches(double value){return value/CentimetersInchesSqFactor;}
	public static double sqInchesToSqCentimeters(double value){return value*CentimetersInchesSqFactor;}
	
	public static double sqCentimetersToSqFeet(double value){return value/CentimetersFeetSqFactor;}
	public static double sqFeetToSqCentimeters(double value){return value*CentimetersFeetSqFactor;}
	
	public static double sqCentimetersToSqYards(double value){return value/CentimetersYardsSqFactor;}
	public static double sqYardsToSqCentimeters(double value){return value*CentimetersYardsSqFactor;}
	
	
	
	//sq meters to sq kilometers, sq miles, hectares, acres, sq inches, sq feet, sq yards.
	public final static double MetersKilometersSqFactor				=	1000000.0;			//1 sq kilometer	= 1000000 sq meters.
	public final static double MetersMilesSqFactor					=	2589988.110336;		//1 sq mile			= 2589988.110336 meters.
	public final static double MetersHectaresSqFactor				=	10000.0;			//1 sq hectare		= 10000 sq meters.
	public final static double MetersAcresSqFactor					=	4046.85643;			//1 sq acre			= 4046.85643 sq meters.
	public final static double MetersInchesSqFactor					=	1550.0031;			//1 sq meter		= 1550.0031 sq inches.
	public final static double MetersFeetSqFactor					=	10.76391;			//1 sq meter		= 10.76391 sq feet.
	public final static double MetersYardsSqFactor					=	1.19599;			//1 sq meter		= 1.19599 sq yards.
	
	public static double sqMetersToSqKilometers(double value){return value/MetersKilometersSqFactor;}
	public static double sqKilometersToSqMeters(double value){return value*MetersKilometersSqFactor;}
	
	public static double sqMetersToSqMiles(double value){return value/MetersMilesSqFactor;}
	public static double sqMilesToSqMeters(double value){return value*MetersMilesSqFactor;}
	
	public static double sqMetersToHectares(double value){return value/MetersHectaresSqFactor;}
	public static double hectaresToSqMeters(double value){return value*MetersHectaresSqFactor;}
	
	public static double sqMetersToAcres(double value){return value/MetersAcresSqFactor;}
	public static double acresToSqMeters(double value){return value*MetersAcresSqFactor;}
	
	public static double sqMetersToSqInches(double value){return value*MetersInchesSqFactor;}
	public static double sqInchesToSqMeters(double value){return value/MetersInchesSqFactor;}
	
	public static double sqMetersToSqFeet(double value){return value*MetersFeetSqFactor;}
	public static double sqFeetToSqMeters(double value){return value/MetersFeetSqFactor;}
	
	public static double sqMetersToSqYards(double value){return value*MetersYardsSqFactor;}
	public static double sqYardsToSqMeters(double value){return value/MetersYardsSqFactor;}
	
	//sq kilometers to sq miles, hectares, acres, sq inches, sq feet, sq yards.
	public final static double KilometersMilesSqFactor				=	2.58998811;			//1 sq mile			= 2.58998811 sq kilometers.
	public final static double KilometersHectaresSqFactor			=	100.0;				//1 sq kilometer	= 100 hectares.
	public final static double KilometersAcresSqFactor				=	247.105381;			//1 sq kilometer	= 247.105381 acres.
	public final static double KilometersInchesSqFactor				=	1550003100.006;		//1 sq kilometer	= 1550003100 sq inches.
	public final static double KilometersFeetSqFactor				=	10763910.416;		//1 sq kilometer	= 10763910.416 sq feet.
	public final static double KilometersYardsSqFactor				=	1195990.6;			//1 sq kilometer	= 1195990.6 sq yards.

	public static double sqKilometersToSqMiles(double value){return value/KilometersMilesSqFactor;}
	public static double sqMilesToSqKilometers(double value){return value*KilometersMilesSqFactor;}
	
	public static double sqKilometersToHectares(double value){return value*KilometersHectaresSqFactor;}
	public static double hectaresToSqKilometers(double value){return value/KilometersHectaresSqFactor;}
	
	public static double sqKilometersToAcres(double value){return value*KilometersAcresSqFactor;}
	public static double acresToSqKilometers(double value){return value/KilometersAcresSqFactor;}
	
	public static double sqKilometersToSqInches(double value){return value*KilometersInchesSqFactor;}
	public static double sqInchesToSqKilometers(double value){return value/KilometersInchesSqFactor;}
	
	public static double sqKilometersToSqFeet(double value){return value*KilometersFeetSqFactor;}
	public static double sqFeetToSqKilometers(double value){return value/KilometersFeetSqFactor;}
	
	public static double sqKilometersToSqYards(double value){return value*KilometersYardsSqFactor;}
	public static double sqYardsToSqKilometers(double value){return value/KilometersYardsSqFactor;}
	
	
	//sq miles to hectares, acres, sq inches, sq feet, sq yards.
	public final static double MilesHectaresSqFactor				=	258.998811034;		//1 sq mile			= 258.998811034 hectares.
	public final static double MilesAcresSqFactor					=	640.0;				//1 sq mile			= 640 acres.
	public final static double MilesInchesSqFactor					=	4014489600.0;		//1 sq mile			= 4014489600 sq inches.
	public final static double MilesFeetSqFactor					=	27878400.0;			//1 sq mile			= 27878400 sq feet.
	public final static double MilesYardsSqFactor					=	3097600.0;			//1 sq mile			= 3097600 sq yards.
	
	public static double sqMilesToHectares(double value){return value*MilesHectaresSqFactor;}
	public static double hectaresToSqMiles(double value){return value/MilesHectaresSqFactor;}

	public static double sqMilesToAcres(double value){return value*MilesAcresSqFactor;}
	public static double acresToSqMiles(double value){return value/MilesAcresSqFactor;}
	
	public static double sqMilesToSqInches(double value){return value*MilesInchesSqFactor;}
	public static double sqInchesToSqMiles(double value){return value/MilesInchesSqFactor;}
	
	public static double sqMilesToSqFeet(double value){return value*MilesFeetSqFactor;}
	public static double sqFeetToSqMiles(double value){return value/MilesFeetSqFactor;}

	public static double sqMilesToSqYards(double value){return value*MilesYardsSqFactor;}
	public static double sqYardsToSqMiles(double value){return value/MilesYardsSqFactor;}

	//hectare to acres, sq inches, sq feet, sq yards.
	public final static double HectaresAcresSqFactor				=	2.47105381;			//1 hectare			= 2.47105381 acres.
	public final static double HectaresInchesSqFactor				=	15500031;			//1 hectare			= 15500031 sq inches.
	public final static double HectaresFeetSqFactor					=	107639.10416;		//1 hectare			= 107639.10416 sq feet.
	public final static double HectaresYardsSqFactor				=	11959.9005;			//1 hectare			= 11959.9005 sq yards.
	
	public static double hectaresToAcres(double value){return value*HectaresAcresSqFactor;}
	public static double acresToHectares(double value){return value/HectaresAcresSqFactor;}
	
	public static double hectaresToSqInches(double value){return value*HectaresInchesSqFactor;}
	public static double sqInchesToHectares(double value){return value/HectaresInchesSqFactor;}
	
	public static double hectaresToSqFeet(double value){return value*HectaresFeetSqFactor;}
	public static double sqFeetToHectares(double value){return value/HectaresFeetSqFactor;}
	
	public static double hectaresToSqYards(double value){return value*HectaresYardsSqFactor;}
	public static double sqYardsToHectares(double value){return value/HectaresYardsSqFactor;}
	
	
	
	//acres to sq inches, sq feet, sq yards.
	public final static double AcresInchesSqFactor					=	6272640;			//1 acre			= 6272640 sq inches.
	public final static double AcresFeetSqFactor					=	43560;				//1 acre			= 43560 sq feet.
	public final static double AcresYardsSqFactor					=	4840.0021;			//1 acre			= 4840.0021 sq yards.
	
	public static double acresToSqInches(double value){return value*AcresInchesSqFactor;}
	public static double sqInchesToAcres(double value){return value/AcresInchesSqFactor;}
	
	public static double acresToSqFeet(double value){return value*AcresFeetSqFactor;}
	public static double sqFeetToAcres(double value){return value/AcresFeetSqFactor;}
	
	public static double acresToSqYards(double value){return value*AcresYardsSqFactor;}
	public static double sqYardsToAcres(double value){return value/AcresYardsSqFactor;}
	
	
	//sq inches to sq feet, sq yards.
	public final static double InchesFeetSqFactor					=	144;				//1 sq feet			= 144 sq inches.
	public final static double InchesYardsSqFactor					=	1296;				//1 sq yard			= 1296 sq inches.
	
	public static double sqInchesToSqFeet(double value){return value/InchesFeetSqFactor;}
	public static double sqFeetToSqInches(double value){return value*InchesFeetSqFactor;}
	
	public static double sqInchesToSqYards(double value){return value/InchesYardsSqFactor;}
	public static double sqYardsToSqInches(double value){return value*InchesYardsSqFactor;}
	
	
	
	//sq feet to sq yards.
	public final static double FeetYardsSqFactor					=	9;					//1 sq yard			= 9 sq feet.
	
	public static double sqFeetToSqYards(double value){return value/FeetYardsSqFactor;}
	public static double sqYardsToSqFeet(double value){return value*FeetYardsSqFactor;}
	
}
